package com.sun.hunk.menu;

import com.sun.hunk.hibernate.dao.LinkTreeDAO;
import com.sun.hunk.hibernate.domain.Link;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author sunil
 */
public class MenuUtil {

    private final static int QUOTE_BOOKING_BL = 2;

    public Map<Link, Set<Link>> getMainMenu() {
        LinkTreeDAO dao = new LinkTreeDAO();
        //dao.getCurrentSession().beginTransaction();
        return dao.getMainMenu();
    }

    public static Link getItem(Long itemId) {
        return new Menu().getItem(itemId);
    }
  

    /**
     * This method will return the list of Items for bread crumb
     * @param itemId
     * @return
     */
    public List<Link> getBreadcrumb(String itemId) {
        if(itemId == null){
            return new ArrayList<Link>();
        }else{
            return new Menu().getBreadcrumb(itemId);
        }
    }

    public static List<MenuItem> getTabsTreeList(String parentId, String ... options) {
        Menu menu = new Menu();
        return menu.getTabsTreeList(parentId, options);
    }
}
